home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / windows / uts60323.zip / UTS60323.EXE / INSTALL.MST < prev    next >
Text File  |  1997-02-12  |  26KB  |  566 lines

  1. '==============================================================================
  2. '*                       Inet for Windows Setup Script
  3. '==============================================================================
  4. '$DEFINE DEBUG  ''Define for script development/debugging
  5.  
  6. '$INCLUDE 'setupapi.inc'
  7. '$INCLUDE 'msdetect.inc'
  8.  
  9. CONST WELCOME_ALL  = 100     '100 "INET for Windows Installation"
  10. CONST WELCOME_APPS = 101     '
  11. CONST WELCOME_LITE = 102     '
  12. CONST WELCOME_VT   = 103     '
  13. CONST WELCOME_UTS  = 104     '
  14. CONST WELCOME_HLPA = 120     '
  15. CONST WELCOME_HLP  = 121     '
  16. CONST ASKQUIT      = 200     '200 "INET for Windows Quit"
  17. CONST DESTDRIVE    = 300     '300 "INET for Windows Destination Drive"
  18. CONST ICONDRIVE    = 301     '301 "INET for Windows Directory"
  19. CONST IPADDRESS    = 310     '310 "INET for Windows: IP address"
  20. CONST UTS60PID     = 320     '320 "UTS60 for Windows: PID"
  21. CONST DEFAULTHOST  = 330     '330 "UTS60 for Windows: Host"
  22. CONST CMDLINEPAR   = 340     '340 "INET for Windows: Command line parameters"
  23. CONST UTS60DCP     = 350     '350 "UTS60 for Windows: DCP/HLC"
  24. CONST EXITFAILURE  = 400     '400 "INET for Windows Setup Failure!"
  25.                              '5xx = 3xx se help dialogs - use +200
  26. CONST EXITQUIT     = 600     '600 "INET for Windows Early Exit Warning"
  27. CONST EXITSUCCESS  = 700     '700 "INET for Windows Setup Completed!"
  28. CONST PKTDRVINSTAL = 800     '800 "Packet driver installation"
  29. CONST PKTDRVWFW    = 810     '810 "Packet driver for Windows for Workgroups"
  30. CONST APPHELP      = 900     '900 "INET for Windows Help"
  31. CONST PATH_ERR     = 1000
  32. CONST TOOBIG       = 1100
  33.                                  'Check your maths so that:
  34. CONST INSTALL_ALL    = 0         '= WELCOME_ALL - WELCOME_ALL
  35. CONST INSTALL_APPS   = 1         '= WELCOME_APPS- WELCOME_ALL
  36. CONST INSTALL_LITE   = 2         '= WELCOME_LITE- WELCOME_ALL
  37. CONST INSTALL_VT     = 3         '= WELCOME_VT  - WELCOME_ALL
  38. CONST INSTALL_UTS    = 4         '= WELCOME_UTS - WELCOME_ALL
  39. CONST INSTALL_ICONS  = 5
  40.  
  41. GLOBAL DEST$
  42. GLOBAL INETDLL$
  43. GLOBAL temp$
  44. GLOBAL Drive$
  45. GLOBAL WindowsDir$
  46. GLOBAL InetDir$
  47. GLOBAL WindowsSystemDir$
  48. GLOBAL InstallOption%
  49. GLOBAL ProductNumber%
  50. DECLARE SUB Install
  51. DECLARE SUB Make_Icons 
  52. DECLARE SUB Pkt_Driver 
  53. DECLARE FUNCTION MakePath(szDir$, szFile$) AS STRING
  54.  
  55. INIT:
  56.     InetDir$ = "INET"
  57.     DEST$ = "WINET"
  58.     INETDLL$ = "INSTALL.DLL"             ''user interface dll
  59.  
  60.     SetTitle "INET for Windows Setup"
  61.     SetBitmap INETDLL$, 1
  62.  
  63.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  64.     IF szInf$ = "" THEN
  65.         szInf$ = GetSymbolValue("STF_CWDDIR") + "INSTALL.INF"
  66.     END IF
  67.     ReadInfFile szInf$
  68.  
  69.     WindowsDir$ = GetWindowsDir
  70.     WindowsSystemDir$ = GetWindowsSysDir
  71.     WinDrive$ = MID$(WindowsDir$, 1, 1)
  72.     IF IsDriveValid(WinDrive$) = 0 THEN
  73.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  74.         GOTO QUIT
  75.     END IF
  76.  
  77. WELCOME:
  78.                                                        
  79. WHICH_PRODUCT:          'Test for *.dsk file that labels the different products
  80.  
  81.         ProductNumber% = INSTALL_ALL    'Default if no *.dsk file found
  82.  
  83.     SrcDir$ = GetSymbolValue("STF_SRCDIR")+"inetvt.dsk"
  84.     IF DoesFileExist(SrcDir$,femExist) THEN
  85.         ProductNumber% = INSTALL_VT
  86.         SetTitle "INET for Windows Setup: VTx00"
  87.     END IF
  88.     SrcDir$ = GetSymbolValue("STF_SRCDIR")+"inetlite.dsk"
  89.     IF DoesFileExist(SrcDir$,femExist) THEN
  90.         ProductNumber% = INSTALL_LITE
  91.         SetTitle "INET for Windows Setup: Lite"
  92.     END IF
  93.     SrcDir$ = GetSymbolValue("STF_SRCDIR")+"inetapps.dsk"
  94.     IF DoesFileExist(SrcDir$,femExist) THEN
  95.         ProductNumber% = INSTALL_APPS
  96.         SetTitle "INET for Windows Setup: Applications"
  97.     END IF
  98.     SrcDir$ = GetSymbolValue("STF_SRCDIR")+"inetuts.dsk"
  99.     IF DoesFileExist(SrcDir$,femExist) THEN
  100.         ProductNumber% = INSTALL_UTS
  101.         SetTitle "INET for Windows Setup: UTS60"
  102.     END IF
  103.  
  104. WELCOME1:
  105.                                                        
  106.     IF ProductNumber% = INSTALL_ALL THEN
  107.         sz$ = UIStartDlg(INETDLL$, WELCOME_ALL+ProductNumber%, "ErichInstall", WELCOME_HLPA, "FHelpDlgProc")
  108. '        sz$ = UIStartDlg(INETDLL$, WELCOME_ALL+ProductNumber%, "FEditDlgProc", WELCOME_HLPA, "FHelpDlgProc")
  109.     ELSE
  110.         sz$ = UIStartDlg(INETDLL$, WELCOME_ALL+ProductNumber%, "ErichInstall", WELCOME_HLP, "FHelpDlgProc")
  111. '        sz$ = UIStartDlg(INETDLL$, WELCOME_ALL+ProductNumber%, "FEditDlgProc", WELCOME_HLP, "FHelpDlgProc")
  112.     END IF
  113.  
  114.     IF sz$ = "BUTTON_F" THEN                    'pressed Full
  115. '        InstallOption% = INSTALL_ALL
  116. '        InstallOption% = INSTALL_APPS
  117. '        InstallOption% = INSTALL_LITE  
  118. '        InstallOption% = INSTALL_VT
  119. '        InstallOption% = INSTALL_UTS
  120.         InstallOption% = ProductNumber%
  121.     ELSEIF sz$ = "BUTTON_I" THEN                'pressed Icons
  122.         InstallOption% = INSTALL_ICONS
  123.     ELSEIF sz$ = "BUTTON_A" THEN                'pressed Apps
  124.         ProductNumber% = INSTALL_APPS
  125.         InstallOption% = ProductNumber%
  126.     ELSEIF sz$ = "BUTTON_P" THEN                'pressed aPps icons
  127.         ProductNumber% = INSTALL_APPS
  128.         InstallOption% = INSTALL_ICONS
  129.     ELSEIF sz$ = "BUTTON_H" THEN                'pressed Help
  130.         i% = DoMsgBox("You may select to install the full product or only create the icons if the files are already installed in some directory.", "INET for Windows Help", MB_TASKMODAL+MB_OK)
  131.         IF ProductNumber% = INSTALL_ALL THEN
  132.            i% = DoMsgBox("If you are using a third party TCP/IP Winsock (e.g. Windows 95), install the Applications only to exclude the INET Winsock.", "INET for Windows Help", MB_TASKMODAL+MB_OK)
  133.            i% = DoMsgBox("Applications include all the terminal emulators and printer servers and clients.", "INET for Windows Help", MB_TASKMODAL+MB_OK)
  134.         END IF
  135.         GOTO WELCOME1
  136.     ELSEIF sz$ = "BUTTON_O" THEN                'pressed Overview
  137.         i% = DoMsgBox("An overview is available in README.TXT and INETINFO.WRI on the install disk. Install shall make icons for these files.", "INET for Windows Help", MB_TASKMODAL+MB_OK)
  138.         GOTO WELCOME1
  139.     ELSE                                        'pressed eXit or anything
  140.         GOSUB ASKQUIT
  141.         GOTO WELCOME1
  142.     END IF
  143.  
  144. GETDRIVE:
  145.     UIPop 1
  146.     DEST$ = GetEnvVariableValue("WINET")
  147.     IF DEST$ = "" THEN
  148.         DEST$ = WinDrive$+":\WINET"
  149.     END IF
  150.     SetSymbolValue "EditTextIn", DEST$
  151.     SetSymbolValue "EditFocus", "END"
  152.     'Ask destination dir
  153.     IF InstallOption% = INSTALL_ICONS THEN
  154.         sz$ = UIStartDlg(INETDLL$, ICONDRIVE, "FEditDlgProc", ICONDRIVE+200, "FHelpDlgProc")
  155.     ELSE
  156.         sz$ = UIStartDlg(INETDLL$, DESTDRIVE, "FEditDlgProc", DESTDRIVE+200, "FHelpDlgProc")
  157.     END IF
  158.     IF sz$ = "BUTTON_C" THEN            'Continue
  159.         DEST$ = GetSymbolValue("EditTextOut")
  160.         Drive$ = MID$(DEST$, 2, 2 )
  161.         IF Drive$ <> ":\" THEN
  162. '           sz$ = UIStartDlg(INETDLL$, PATH_ERR, "InstallOptions", APPHELP, "FHelpDlgProc")
  163.            sz$ = UIStartDlg(INETDLL$, PATH_ERR, "FInfo0DlgProc", 0, "")
  164.            GOTO GETDRIVE
  165.         END IF
  166.         Drive$ = MID$(DEST$, 1, 1)
  167.         Drive$ = Drive$ + ":\"
  168.         DEST$ = MID$(DEST$, 4, len(DEST$)-2 )
  169.         IF IsDriveValid(Drive$) = 0 THEN
  170.            sz$ = UIStartDlg(INETDLL$, PATH_ERR, "FInfo0DlgProc", 0, "")
  171.            GOTO GETDRIVE
  172.         END IF
  173.         UIPop 1
  174.  
  175. 'ICONS ONLY test
  176.         IF InstallOption% = INSTALL_ICONS AND DoesFileExist(Drive$+DEST$+"\inetinfo.wri",femExists) = 0 THEN
  177.            i% = DoMsgBox("Your selected directory "+Drive$+DEST$+" does not contain installed programs.  The flag file, INETINFO.WRI, must be available to continue.", "Inet Setup Warning", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  178.            GOSUB ASKQUIT
  179.            GOTO GETDRIVE                       'dis/allow a stupid continue
  180.         END IF
  181.  
  182. 'Actual installation
  183.         Install
  184.         Make_Icons 
  185.         GOSUB Configure
  186.  
  187.         GOTO    QUIT
  188.     ELSEIF sz$ = "REACTIVATE" THEN              'pressed Ctrl-F4?
  189.         GOTO GETDRIVE
  190.     ELSEIF sz$ = "BUTTON_X" THEN                'pressed eXit
  191.         GOSUB ASKQUIT
  192.         GOTO GETDRIVE
  193.     ELSEIF sz$ = "BUTTON_B" THEN                'pressed Back
  194.         UIPop 1
  195.         GOTO WELCOME
  196.     ELSE                                        'Esc kom hier uit.
  197.         GOSUB ASKQUIT
  198.         GOTO GETDRIVE
  199.     END IF
  200.  
  201.  
  202. QUIT:
  203.     ON ERROR GOTO ERRQUIT
  204.  
  205.     'If there was no prev Inet installation, and he wants kernel, tell info about drivers etc.
  206.     sz$ = GetEnvVariableValue("INET")
  207. '    IF sz$ = "" THEN
  208.     IF ProductNumber% = INSTALL_LITE OR ProductNumber% = INSTALL_ALL THEN
  209.         dlg% = PKTDRVINSTAL 
  210.         sz$ = UIStartDlg(INETDLL$, dlg%, "ErichInstall", dlg%, "FHelpDlgProc")
  211.         IF sz$ = "BUTTON_W" THEN            'eXit
  212.             dlg% = PKTDRVWFW 
  213.             sz$ = UIStartDlg(INETDLL$, dlg%, "FInfo0DlgProc", 0, "")
  214.             UIPop 1
  215.         END IF
  216.         UIPop 1
  217.     END IF
  218. '    END IF
  219.  
  220.     IF ERR = 0 THEN
  221.         dlg% = EXITSUCCESS
  222.     ELSEIF ERR = STFQUIT THEN
  223.         dlg% = EXITQUIT
  224.     ELSE
  225.         dlg% = EXITFAILURE
  226.     END IF
  227.  
  228. QUITL1:
  229.     sz$ = UIStartDlg(INETDLL$, dlg%, "FInfo0DlgProc", 0, "")
  230.     IF sz$ = "REACTIVATE" THEN                'Back
  231.         GOTO QUITL1
  232.     END IF
  233.     UIPop 1
  234.     END
  235.  
  236. ERRQUIT:
  237.     i% = DoMsgBox("Setup sources were corrupted! Call your supplier or LanDesign", "Inet Setup Error", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  238.     END
  239.  
  240. ASKQUIT:
  241.     sz$ = UIStartDlg(INETDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  242.  
  243.     IF sz$ = "BUTTON_X" THEN            'eXit
  244.         UIPopAll
  245.         ERROR STFQUIT
  246.     ELSEIF sz$ = "REACTIVATE" THEN      'Ctrl-F4?
  247.         GOTO ASKQUIT
  248.     ELSE                                'Continue or Esc
  249.         UIPop 1
  250.     END IF
  251.     RETURN
  252.  
  253. Configure:
  254.  
  255. HOSTFILE:
  256.     temp$ = ""
  257.     temp$ = GetIniKeyString (WindowsDir$+"INET.INI", "IP", "Address")
  258.     IF temp$ = "" THEN
  259.         IF ProductNumber% <> INSTALL_LITE AND ProductNumber% <> INSTALL_ALL THEN
  260.             'No INET kernel: get default hosts file from MS TCP/IP: windows\hosts
  261.             CopyFile Drive$+DEST$+"\INET.HST", WindowsDir$+"HOSTS", cmoNone, 1   'Make sure that HOSTS exist, or append
  262.             CreateIniKeyValue WindowsDir$+"INET.INI", "Hostfiles", "Hostfile", WindowsDir$+"HOSTS", cmoOverwrite
  263.         ELSE
  264.             CreateIniKeyValue WindowsDir$+"INET.INI", "Hostfiles", "Hostfile", Drive$+DEST$+"\INET.HST", cmoOverwrite
  265.         END IF
  266.     END IF
  267.  
  268. ASK_IP:
  269.     'Ask IP address
  270.     IF ProductNumber% = INSTALL_LITE OR ProductNumber% = INSTALL_ALL THEN
  271.         temp$ = ""
  272.         temp$ = GetIniKeyString (WindowsDir$+"INET.INI", "IP", "Address")
  273.         SetSymbolValue "EditTextIn", temp$
  274.         SetSymbolValue "EditFocus", "END"
  275.         sz$ = UIStartDlg(INETDLL$, IPADDRESS, "FEditDlgProc", APPHELP, HELPPROC$)
  276.         IF sz$ = "BUTTON_C" THEN            'Continue
  277.             temp$ = GetSymbolValue("EditTextOut")
  278.             CreateIniKeyValue WindowsDir$+"INET.INI", "IP", "Address", temp$, cmoOverwrite
  279.         ELSEIF sz$ = "BUTTON_X" THEN            'pressed eXit
  280.             GOSUB ASKQUIT
  281.             GOTO ASK_IP
  282.         ELSEIF sz$ = "BUTTON_B" THEN            'pressed Back
  283.             GOTO WELCOME
  284.         ELSE                                    'pressed Esc
  285.             GOSUB ASKQUIT
  286.             GOTO ASK_IP
  287.         END IF
  288.  
  289.     END IF
  290.  
  291. ASK_PID:
  292.     IF ProductNumber% = INSTALL_UTS THEN
  293.  
  294.     'Ask PID for UTS
  295.         SetSymbolValue "EditTextIn", "P01000"
  296. '        SetSymbolValue "EditTextIn", "P01"     '=NBS= put your template PID #1 here
  297.         SetSymbolValue "EditFocus", "END"
  298.         sz$ = UIStartDlg(INETDLL$, UTS60PID, "FEditDlgProc", UTS60PID+200, "FHelpDlgProc")
  299.         UIPop 1
  300.         IF sz$ = "BUTTON_C" THEN                'Continue
  301.             temp$ = GetSymbolValue("EditTextOut")
  302.             CreateIniKeyValue WindowsDir$+"INETUTS.INI", "Inet UTS60 Logon", "Pid", temp$, cmoOverwrite
  303.         ELSEIF sz$ = "BUTTON_X" THEN            'pressed eXit
  304.             GOSUB ASKQUIT
  305.             GOTO ASK_PID
  306.         ELSEIF sz$ = "BUTTON_B" THEN            'pressed Back
  307.             GOTO WELCOME
  308.         ELSE                                    'pressed Esc
  309.             GOSUB ASKQUIT
  310.             GOTO ASK_PID
  311.         END IF
  312.  
  313. ASK_HLC:
  314.     'Ask DPC/HLC for UTS
  315. '        sz$ = UIStartDlg(INETDLL$, UTS60DCP, "FEditDlgProc", UTS60DCP+200, "FHelpDlgProc")
  316. '        sz$ = UIStartDlg(INETDLL$, UTS60DCP, "FQuitDlgProc", UTS60DCP+200, "FHelpDlgProc")
  317.         sz$ = UIStartDlg(INETDLL$, UTS60DCP, "ErichInstall", UTS60DCP+200, "FHelpDlgProc")
  318.         UIPop 1
  319.         IF sz$ = "BUTTON_D" THEN                'DCP
  320.             CreateIniKeyValue WindowsDir$+"INETUTS.INI", "Inet UTS60 Settings", "HLC", "0", cmoOverwrite
  321.         ELSEIF sz$ = "BUTTON_C" THEN                'HLC
  322.             CreateIniKeyValue WindowsDir$+"INETUTS.INI", "Inet UTS60 Settings", "HLC", "1", cmoOverwrite
  323.         ELSEIF sz$ = "BUTTON_X" THEN            'pressed eXit
  324.             GOSUB ASKQUIT
  325.             GOTO ASK_HLC
  326.         ELSEIF sz$ = "BUTTON_H" THEN            'pressed Help
  327.             i% = DoMsgBox("Rather press F1 from the previous screen to get help.", "INET UTS60 Help", MB_TASKMODAL+MB_OK)
  328.             GOTO ASK_HLC
  329.         ELSEIF sz$ = "BUTTON_B" THEN            'pressed Back
  330.             GOTO ASK_PID
  331.         ELSE                                    'pressed Esc
  332.             GOSUB ASKQUIT
  333.             GOTO ASK_PID
  334.         END IF
  335.  
  336. GOTO SKIP_NBS
  337. '=============================================================================
  338. '
  339. ' Special additions for NBS Bank.  See also lines marked with =NBS=.
  340. ' This install procedure will create 3 extra icons for Mapper, OFIS and TIP.
  341. '       The commandline parameters can be modified in INSTALL.MST (this file)
  342. '       You MUST at least go and change the host names in the 
  343. '       CreateProgmanItem statements:   /h=mapper_host
  344. '                                       /h=ofis_host 
  345. '                                       /h=tip_host 
  346. ' It also creates 3 .INI files.
  347. '       The options like System and Environment can be modified in INSTALL.MST
  348. '       The System and Environment fields might need change in the 
  349. '       CreateIniKeyValue statements.
  350. '=============================================================================
  351.  
  352. 'Copy 3 .INI files with PID #1 already in
  353.         CopyFile WindowsDir$+"INETUTS.INI", WindowsDir$+"MAPPER.INI", cmoOverwrite, 0
  354.         CopyFile WindowsDir$+"INETUTS.INI", WindowsDir$+"OFIS.INI", cmoOverwrite, 0
  355.         CopyFile WindowsDir$+"INETUTS.INI", WindowsDir$+"TIP.INI", cmoOverwrite, 0
  356.  
  357. 'Ask for 2nd PID for TIP
  358.         SetSymbolValue "EditTextIn", "P02"    '=NBS= put your template for PID 2 here
  359.         SetSymbolValue "EditFocus", "END"
  360.         sz$ = UIStartDlg(INETDLL$, UTS60PID, "FEditDlgProc", UTS60PID+200, "FHelpDlgProc")
  361.         UIPop 1
  362.         IF sz$ = "BUTTON_C" THEN                'Continue
  363.             temp$ = GetSymbolValue("EditTextOut")
  364.             CreateIniKeyValue WindowsDir$+"TIP.INI", "Inet UTS60 Logon", "Pid", temp$, cmoOverwrite
  365.         ELSEIF sz$ = "BUTTON_X" THEN            'pressed eXit
  366.             GOSUB ASKQUIT
  367.             GOTO ASK_PID
  368.         ELSEIF sz$ = "BUTTON_B" THEN            'pressed Back
  369.             GOTO WELCOME
  370.         ELSE    'IF sz$ = "REACTIVATE" THEN     'pressed Ctrl-F4?
  371.             UIPop 1
  372.             GOTO QUIT
  373.         END IF
  374.  
  375. '=NBS= Statements to modify the .INI files as you like
  376.         CreateIniKeyValue WindowsDir$+"MAPPER.INI", "Inet UTS60 Logon", "Port"       , "256"   , cmoOverwrite
  377.         CreateIniKeyValue WindowsDir$+"MAPPER.INI", "Inet UTS60 Logon", "System"     , ""      , cmoOverwrite
  378.         CreateIniKeyValue WindowsDir$+"MAPPER.INI", "Inet UTS60 Logon", "Environment", "tip"   , cmoOverwrite
  379.         CreateIniKeyValue WindowsDir$+"MAPPER.INI", "Inet UTS60 Logon", "HLC ID"     , "TIPCSU", cmoOverwrite
  380.         CreateIniKeyValue WindowsDir$+"OFIS.INI"  , "Inet UTS60 Logon", "Environment", "tip"   , cmoOverwrite
  381.         CreateIniKeyValue WindowsDir$+"TIP.INI"   , "Inet UTS60 Logon", "Environment", "tip"   , cmoOverwrite
  382.  
  383.  
  384. '=NBS= Create 3 new icons with host names
  385.         CreateProgmanItem "Winet", "Inet Mapper", MakePath(Drive$+DEST$,"iwuts60.exe /h=mapper_host /t=mapper /n"),  "", cmoOverwrite
  386.         CreateProgmanItem "Winet", "Inet OFIS"  , MakePath(Drive$+DEST$,"iwuts60.exe /h=ofis_host /t=ofis /n"),  "", cmoOverwrite
  387.         CreateProgmanItem "Winet", "Inet TIP"   , MakePath(Drive$+DEST$,"iwuts60.exe /h=tip_host /t=tip /n"),  "", cmoOverwrite
  388. '=============================================================================
  389. '
  390. ' End of additions for NBS Bank.  See also lines marked with =NBS=.
  391. '
  392. '=============================================================================
  393. SKIP_NBS:
  394.  
  395.     END IF              'ProductNumber% = INSTALL_UTS 
  396.  
  397. AUTOEXEC:
  398.     temp$ = GetEnvVariableValue("WINET")
  399.     IF temp$ <> Drive$+DEST$ THEN    ' has wrong "WINET" variable, chk autoexec
  400.       IF DoesFileExist("c:\autoexec.bat",femExists) = 1 THEN
  401.           temp$ = ""
  402.           temp$ = GetIniKeyString ("c:\autoexec.bat", ": The next line was inserted by INET for Windows setup :", "set WINET")
  403.           IF temp$ = "" THEN      'There is no "set WINET", make new file to insert before old .bat
  404.              RemoveFile "c:\autoexec.ine", cmoNone
  405.              RenameFile "c:\autoexec.bat", "autoexec.ine"
  406.              CreateIniKeyValue "c:\autoexec.bat", ": The next line was inserted by INET for Windows setup :", "set WINET", Drive$+DEST$, cmoOverwrite
  407.              'CreateIniKeyValue "c:\autoexec.bat", ": The next line was inserted by INET for Windows setup :", "set INET", InetDir$, cmoOverwrite
  408.              CopyFile "c:\autoexec.ine", "c:\autoexec.bat", cmoNone, 1    'append old copy to new file
  409.              i% = DoMsgBox("I have inserted a SET WINET="+Drive$+DEST$+" statement in C:\AUTOEXEC.BAT. The old file is now C:\AUTOEXEC.INE.  A reboot is recommended.", "Inet Setup Information", MB_OK+MB_TASKMODAL)
  410.           ELSEIF temp$ <> Drive$+DEST$ THEN    ' has wrong "set WINET", change it
  411.               CreateIniKeyValue "c:\autoexec.bat", ": The next line was inserted by INET for Windows setup :", "set WINET", Drive$+DEST$, cmoOverwrite
  412.               'CreateIniKeyValue "c:\autoexec.bat", ": The next line was inserted by INET for Windows setup :", "set INET", InetDir$, cmoOverwrite
  413.               i% = DoMsgBox("The SET WINET="+temp$+" statement in C:\AUTOEXEC.BAT has been changed to SET WINET="+Drive$+DEST$+".  A reboot is recommended.", "Inet Setup Information", MB_OK+MB_TASKMODAL)
  414.           END IF
  415.       ELSE
  416.           i% = DoMsgBox("A SET WINET="+Drive$+DEST$+" statement is needed to set the environment, but I could not find C:\AUTOEXEC.BAT.", "Inet Setup Warning", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  417.       END IF
  418.     END IF
  419.  
  420. RETURN
  421.  
  422. SUB Install STATIC
  423.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  424.     ClearCopyList
  425.  
  426.     IF InstallOption% <> INSTALL_ICONS THEN
  427.     CreateDir Drive$+DEST$, cmoNone
  428.     CreateDir Drive$+InetDir$, cmoNone
  429.  
  430. ' Which file sections to copy:
  431. '                     Full    Lite    Apps    VT     UTS
  432. '       Kernel          1      1       0       0      0
  433. '       Applications    1      0       1       0      0
  434. '       Windows         1      0       1       0      0
  435. '       UTS60           0      0       0       0      1
  436. ' Always copy:
  437. '       ApplicationsVT  1      1       1       1      0
  438. '       WindowsVT       1      1       1       1      0
  439. '       System          1      1       1       1      1
  440. '       Winet           1      1       1       1      1
  441. ' For DONTWIPE.ME! copy:
  442. '       Inet
  443.  
  444.         IF InstallOption% = INSTALL_ALL THEN
  445.             AddSectionFilesToCopyList "Kernel", SrcDir$, Drive$+DEST$
  446.             AddSectionFilesToCopyList "Applications", SrcDir$, Drive$+DEST$
  447.             AddSectionFilesToCopyList "Windows", SrcDir$, WindowsDir$
  448.         END IF
  449.         IF InstallOption% = INSTALL_APPS THEN
  450.             AddSectionFilesToCopyList "Applications", SrcDir$, Drive$+DEST$
  451.             AddSectionFilesToCopyList "Windows", SrcDir$, WindowsDir$
  452.         END IF
  453.         IF InstallOption% = INSTALL_LITE THEN
  454.             AddSectionFilesToCopyList "Kernel", SrcDir$, Drive$+DEST$
  455.         END IF
  456.         IF InstallOption% = INSTALL_UTS THEN
  457.             AddSectionFilesToCopyList "UTS60", SrcDir$, Drive$+DEST$
  458.         END IF
  459.  
  460.         'Check for existing dontwipe.me before copying
  461.         InetDir$ = GetEnvVariableValue("INET")
  462.         IF InetDir$ = "" THEN
  463.             InetDir$ = Drive$+"INET"
  464.         END IF
  465.             'Always try to copy dontwipe.me if it is missing in \inet
  466.         IF DoesFileExist(InetDir$+"\dontwipe.me!",femExists) = 0 THEN
  467.             AddSectionFilesToCopyList "Inet", SrcDir$, InetDir$
  468.         ELSEIF DoesFileExist(SrcDir$+"dontwipe.me!",femExists) = 1 THEN
  469.             'Always copy the dontwipe.me! if it exists in the source
  470.             AddSectionFilesToCopyList "Inet", SrcDir$, InetDir$
  471.         END IF
  472.             'Only upgrades should not try to copy dontwipe.me 
  473.  
  474.         'Sections always copied
  475.         IF InstallOption% <> INSTALL_UTS THEN
  476.             AddSectionFilesToCopyList "ApplicationsVT", SrcDir$, Drive$+DEST$
  477.             AddSectionFilesToCopyList "WindowsVT", SrcDir$, WindowsDir$
  478.         END IF
  479.         AddSectionFilesToCopyList "System", SrcDir$, WindowsSystemDir$
  480.         AddSectionFilesToCopyList "Winet", SrcDir$, Drive$+DEST$
  481.  
  482.         CopyFilesInCopyList
  483.  
  484.         'Copy dontwipe from inet to winet dir.  The inet dir is used only temp till winet variable has been set.
  485.         IF DoesFileExist(InetDir$+"\dontwipe.me!",femExists) = 1 THEN
  486.             CopyFile InetDir$+"\dontwipe.me!", Drive$+DEST$+"\dontwipe.me!", cmoOverwrite, 0   
  487.         END IF
  488.  
  489.     END IF
  490.  
  491. END SUB
  492.  
  493. SUB Make_Icons STATIC
  494.  
  495.     CreateProgmanGroup "Winet", "", cmoNone
  496.     ShowProgmanGroup  "Winet", 1, cmoNone
  497.  
  498.     'Icon for shareware
  499.     IF DoesFileExist(MakePath(Drive$+DEST$, "register.txt"),femExists) = 1 THEN
  500.         CreateProgmanItem "Winet", "Register", "notepad.exe" + " " + MakePath(Drive$+DEST$, "register.txt"), "", cmoOverwrite
  501.     END IF
  502.  
  503.     'Icons for Kernel
  504.     IF ProductNumber% = INSTALL_LITE OR ProductNumber% = INSTALL_ALL THEN
  505.         CreateProgmanItem "Winet", "Inet Setup",        MakePath(Drive$+DEST$,"iwkernel.exe"), "", cmoOverwrite
  506.         CreateProgmanItem "Winet", "Inet Ping",         MakePath(Drive$+DEST$,"iwping.exe"),   "", cmoOverwrite
  507.     END IF
  508.  
  509.     'Icons for ApplicationsVT (always)
  510.     IF ProductNumber% <> INSTALL_UTS THEN
  511.         CreateProgmanItem "Winet", "Inet VT100",        MakePath(Drive$+DEST$,"iwvt100.exe"),  "", cmoOverwrite
  512.         CreateProgmanItem "Winet", "Inet VT220",        MakePath(Drive$+DEST$,"iwvt100.exe /t=vt220"),  "", cmoOverwrite
  513.         CreateProgmanItem "Winet", "Inet VT300",        MakePath(Drive$+DEST$,"iwvt100.exe /t=vt300"),  "", cmoOverwrite
  514.         CreateProgmanItem "Winet", "Inet ANSI-SCO",     MakePath(Drive$+DEST$,"iwvt100.exe /t=ansi-sco"),  "", cmoOverwrite
  515.     END IF
  516.  
  517.     'Icons for Applications
  518.     IF ProductNumber% = INSTALL_APPS OR ProductNumber% = INSTALL_ALL THEN
  519.         CreateProgmanItem "Winet", "Inet 3270",         MakePath(Drive$+DEST$,"iw3270.exe"),   "", cmoOverwrite
  520.         CreateProgmanItem "Winet", "Inet D211",         MakePath(Drive$+DEST$,"iwd211.exe"),   "", cmoOverwrite
  521.         CreateProgmanItem "Winet", "Inet HP 700/92",    MakePath(Drive$+DEST$,"iwhp.exe"),     "", cmoOverwrite
  522.         CreateProgmanItem "Winet", "Inet FTP",          MakePath(Drive$+DEST$,"iwftp.exe"),    "", cmoOverwrite
  523.         CreateProgmanItem "Winet", "Inet FTP Server",   MakePath(Drive$+DEST$,"iwftpsrv.exe"), "", cmoOverwrite
  524.         CreateProgmanItem "Winet", "Inet Print Client", MakePath(Drive$+DEST$,"iwprtcli.exe"), "", cmoOverwrite
  525.         CreateProgmanItem "Winet", "Inet Print Server", MakePath(Drive$+DEST$,"iwprtsrv.exe"), "", cmoOverwrite
  526.         CreateProgmanItem "Winet", "Inet LPD Server",   MakePath(Drive$+DEST$,"iwlpd.exe"),    "", cmoOverwrite
  527.         CreateProgmanItem "Winet", "Inet LPR Client",   MakePath(Drive$+DEST$,"iwlpr.exe"),    "", cmoOverwrite
  528.         CreateProgmanItem "Winet", "Inet Echo Server",  MakePath(Drive$+DEST$,"iwecho.exe"),   "", cmoOverwrite
  529.     END IF
  530.     IF ProductNumber% = INSTALL_UTS THEN
  531.         CreateProgmanItem "Winet", "Inet UTS60",        MakePath(Drive$+DEST$,"iwuts60.exe"),  "", cmoOverwrite
  532.         CreateProgmanItem "Winet", "UTS60 manual", "write.exe" + " " + MakePath(Drive$+DEST$, "uts-man.wri"), "", cmoOverwrite
  533.     END IF
  534.  
  535.     'Last Icon for Kernel
  536.     IF ProductNumber% = INSTALL_LITE   OR ProductNumber% = INSTALL_ALL THEN
  537.         CreateProgmanItem "Winet", "Readme WFW3.11", "notepad.exe" + " " + MakePath(Drive$+DEST$, "wfwodi.txt"), "", cmoOverwrite
  538.     END IF
  539.  
  540.     'Documentation Icons for all
  541.     CreateProgmanItem "Winet", "INET TCP/IP information", "write.exe" + " " + MakePath(Drive$+DEST$, "inetinfo.wri"), "", cmoOverwrite
  542.     CreateProgmanItem "Winet", "Read me", "notepad.exe" + " " + MakePath(Drive$+DEST$, "readme.txt"), "", cmoOverwrite
  543.  
  544.     CreateIniKeyValue "WIN.INI", "fonts", "Inet Fixed Pitch", "INETFONT.FON", cmoNone
  545.  
  546. END SUB
  547.  
  548.  
  549. SUB Pkt_Driver STATIC
  550.             temp$ = GetIniKeyString (WindowsDir$+"INET.INI", "IP", "Address")
  551.             CreateIniKeyValue WindowsDir$+"INET2.INI", "IP", "Address2", temp$, cmoOverwrite
  552. END SUB
  553.  
  554.  
  555. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  556.     IF szDir$ = "" THEN
  557.         MakePath = szFile$
  558.     ELSEIF szFile$ = "" THEN
  559.         MakePath = szDir$
  560.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  561.         MakePath = szDir$ + szFile$
  562.     ELSE
  563.         MakePath = szDir$ + "\" + szFile$
  564.     END IF
  565. END FUNCTION
  566.